home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / utility / uwserver.zip / uwserver.tar / lib / Makefile_4.2 next >
Makefile  |  1991-01-25  |  2KB  |  66 lines

  1. #! /bin/make -f
  2. #
  3. #    uw library makefile (4.2BSD)
  4. #
  5. # INCDIR names the directory in which header files are located.
  6. # SERVERDIR names the directory containing the server source.
  7. # SERVER_OBJS names the object files derived from sources in SERVERDIR.
  8. # OBJECTS names all of the object files required for the library.
  9. #
  10. INCDIR    =    ../h
  11.  
  12. SERVERDIR =    ../server
  13.  
  14. SERVER_OBJS =    $(SERVERDIR)/openpty.o $(SERVERDIR)/uw_env.o
  15.  
  16. OBJECTS    =    uw_cmd.o uw_close.o uw_detach.o uw_fork.o uw_kill.o \
  17.         uw_netadj.o uw_new.o uw_optcmd.o uw_optfn.o uw_options.o \
  18.         uw_perror.o uw_ttype.o \
  19.         uw_rsetopt.o uw_shell.o \
  20.         uw_gvis.o uw_gtype.o uw_gtitle.o uw_gwsize.o uw_gpos.o \
  21.         $(SERVER_OBJS)
  22.  
  23. SOURCES    =    `echo $(OBJECTS) | sed -e 's/\\.o/\\.c/g'`
  24.  
  25. DEFINES    =    `cat ../DEFINES`
  26.  
  27. CFLAGS    =    -O -I$(INCDIR) $(DEFINES)
  28.  
  29. TARGET    =    libuw.a
  30.  
  31. $(TARGET):    $(OBJECTS)
  32.     ar cr $(TARGET) `lorder $(OBJECTS) | tsort`
  33.     ranlib $(TARGET)
  34.     -if [ ! -f uwlib.a ];then ln -s libuw.a uwlib.a;fi
  35.  
  36. $(SERVER_OBJS):
  37.     cd $(SERVERDIR); make `basename $@`
  38.  
  39. lint:
  40.     lint -uhbx -I$(INCDIR) $(DEFINES) $(SOURCES)
  41.  
  42. tags:
  43.     ctags $(SOURCES)
  44.  
  45. depend: 
  46.     grep '^#include' $(SOURCES) | \
  47.     sed -e '/</d' \
  48.         -e 's/:[^"]*"\([^"]*\)".*/: ..\/h\/\1/' \
  49.         -e 's,^../[a-zA-Z0-9]*/\([^\.]*\)\.[cs],\1.o \1.L,' | \
  50.     awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
  51.         else { if (length(rec $$3) > 78) { print rec; rec = $$0; } \
  52.                else rec = rec " " $$3 } } \
  53.           END { print rec } ' > makedep
  54.     echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
  55.     echo '$$r makedep' >>eddep
  56.     echo 'w' >>eddep
  57.     cp Makefile Makefile.bak
  58.     ex - Makefile < eddep
  59.     rm eddep makedep
  60.  
  61. clean:
  62.     -rm *.o
  63.  
  64. # DO NOT DELETE THIS LINE (or the following blank line) -- make depend uses it
  65.  
  66.